<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #dd {
            width: 500px;
            height: 500px;
            background-color: red;
            padding: 0 20px;
            box-sizing: content-box !important;
        }
        #aa {
            width: 100%;
            height: 50px;
            background-color: pink;
        }

        #ss {
            width: 500px;
            height: 500px;
            background-color: red;
            padding: 0 20px;
            box-sizing: border-box !important;
        }
        #ff {
            width: 100%;
            height: 50px;
            background-color: pink;
        }
    </style>
</head>
<body>
    <div id="dd">
        <div id="aa"></div>
    </div>
    <div id="ss">
        <div id="ff"></div>
    </div>
</body>
</html>